package client;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import thrift.Hello;

public class HelloServiceClient {
    public static void main(String[] args) throws TException {
        System.out.println("客户端启动....");
        TTransport transport = new TSocket("localhost", 9898, 30000);
        TProtocol protocol = new TBinaryProtocol(transport);
        Hello.Client client = new Hello.Client(protocol);
        transport.open();
        String result = client.helloString("哈哈");
        System.out.println(result);
    }

}